home *** CD-ROM | disk | FTP | other *** search
- > I was wondering if anyone knows how to copy a bob from a
- > sprite bank to a new position in a sprite bank?
- > (I know how to do this and how to get it in the correct position using
- > the Del Bob and Ins Bob commands)
- > Surely there must be a simple command to copy one bob over
- > another?
-
- Hmmm... don't know of any actual AMOS command that does this,
- but then again I'm not very familiar with AMOS Pro.
-
- For a "quick and easy" solution, I'd just use the method you
- mentioned above, wrap it up in a procedure and you have your
- own custom command:
-
- Procedure CLONE_BOB[SOURCEIMAGE,DESTIMAGE]
- CURRENTSCREEN=Screen
- IMGSTRUCT=Sprite Base(SOURCEIMAGE)
- IMGWIDTH=Deek(IMGSTRUCT)*16
- IMGHEIGHT=Deek(IMGSTRUCT+2)
- IMGDEPTH=Peek(IMGSTRUCT+5)
- Hot Spot SOURCEIMAGE,$0
- Screen Open 7,IMGWIDTH,IMGHEIGHT,2^IMGDEPTH,Lowres
- Curs Off : Cls 0
-
- Paste Bob 0,0,SOURCEIMAGE
- Get Bob DESTIMAGE,0,0 To IMGWIDTH,IMGHEIGHT
-
- Screen Close 7
- Screen CURRENTSCREEN
- End Proc
-
- NOTE: This routine will set the image-handles to 0,0
-
-
- This requires 1 Vbl to clone a 64w X 64h 64-colour bob on my
- 14MHz machine (probably not much faster on any CPU due to the
- heavy reliance on the blitter), so whether it's fast enough to be
- useful or not, only you can decide... ;-)
-
-
- Garfield Benjamin e-mail:gbenjam@sosbbs.com
- Website( http://www.sosbbs.com/~gbenjam ): 50% Complete
-
-